package com.ji.gametest.Impl;




import com.ji.gametest.interfaceDefine.GameStandard;
import com.ji.gametest.interfaceDefine.ResultOperation;
import com.ji.gametest.pojo.Result;

public class GameStandardImpl implements GameStandard {
    @Override
    public Result gamestandard(int person, int computer) {
        Result result = new Result();
        ResultOperation operation = new ResultOperationImpl();
        switch ((person - computer + 3)%3){
            case 0:
                result = operation.StoneScissorsClothByPersonAndComputerDraws();
                break;
            case 1:
                result = operation.StoneScissorsClothByPersonWin();
                break;
            case 2:
                result = operation.StoneScissorsClothByComputerWin();
        }
        return result;
    }



    /**

     * @Description: 石头剪刀布游戏规则 {"剪刀":1, "石头":2,"布":3}
     * 人-电脑 = 0（平）；人-电脑 = 1（人胜）；人-电脑 = -2（人胜）;
     *                  人-电脑 = -1（电脑胜）；人-电脑 = 2（电脑胜）
     * 总结：人-电脑 = 0（平）; (人-电脑+3)%3 = 1（人胜）; (人-电脑+3)%3 = 2（电脑胜）

     */

}